{% extends "base.html" %}
{% block css -%}
<style type="text/css">
.logs_list{
    border-spacing: 0;
    border-collapse: collapse;
    background:#F8F8F8;
    width:100%;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
    border-radius: 8px;
}
.logs_list td,.logs_list th{
    font-size: 13px;
    padding:3px 10px;
    border: 1px solid #e6e6e6;
}

.logs_list td{
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
}
.logs_list th{
    font-weight: bold;
    color: #333;
    line-height: 25px;
    text-align: left;
    padding-left: 10px;
}

.logs_list .center{
    text-align:center;
}
.logs_list strong{font-weight: bold;color:#005DA7;}
.logs_list caption{
    font-size: 16px;
    text-align: left;
    padding: 5px 10px;
    border: 1px solid #e6e6e6;
}
.logs_list .logbook {
    text-align:center;
}

.logs_list .logbook span{
    display:none;
}
.logs_list .logbook:hover{
    position:relative;
    z-index:1;
}
.logs_list .logbook:hover span{
    display:block;
    padding:2px;
    background:#ffffe1;
    border:1px solid #000000;
    color:#333;
    z-index:10;
    position:absolute;
    top:1.2em;
    left:5px;
    width:400px;
}
</style>
{% endblock -%}
{% block content -%}
{% if mylogs -%}
<p><em class="required">*</em> {{_("Only display last 10 logs")}}</p>
<table class="pure-table pure-table-striped logs_list">
    <thead><tr>
        <th class="center">{{_("Time")}}</th>
        <th class="center">{{_("Title")}}</th>
        <th class="center">{{_("Size")}}</th>
        <th class="center">{{_("To")}}</th>
        <th class="center">{{_("Status")}}</th>
    </tr></thead>
    <tbody>
    {% for log in mylogs -%}
    <tr>
        <td class="center">{{ log.time }}</td>
        <td class="logbook">
        {% if log.book|length>20 -%}
        {{log.book[:20]}}...<span>{{log.book}}</span>
        {% else %}{{log.book}}{% endif %}</td>
        <td class="center">{%if log.size %} {{ log.size|filesizeformat }} {% else %} 0 {% endif %}</td>
        <td class="center">{{ log.to }}</td>
        <td class="center">{% if log.status %}{{ log.status }}{% else %}ok{% endif %}</td>
    </tr>
    {% endfor -%}
    </tbody>
</table>
{% else -%}
<p>{{_("Has no log")}}</p>
{% endif -%}
{% if logs -%}
<br />
<em class="required">*</em> {{_("Logs of other users")}}<br />
<table class="pure-table pure-table-striped logs_list">
    <thead><tr>
        <th class="center">{{_("Username")}}</th>
        <th class="center">{{_("Time")}}</th>
        <th class="center">{{_("Title")}}</th>
        <th class="center">{{_("Size")}}</th>
        <th class="center">{{_("To")}}</th>
        <th class="center">{{_("Status")}}</th>
    </tr></thead>
    <tbody>
    {% for u in logs -%}
    {% for log in logs[u] -%}
    <tr>
        <td class="center">{{ u }}</td>
        <td class="center">{{ log.time }}</td>
        <td class="logbook">
        {% if log.book|length>20 -%}
        {{log.book[:20]}}...<span>{{log.book}}</span>
        {% else %}{{log.book}}{% endif %}</td>
        <td class="center">{%if log.size %} {{ log.size|filesizeformat }} {% else %} 0 {% endif %}</td>
        <td class="center">{{ log.to }}</td>
        <td class="center">{% if log.status %}{{ log.status }}{% else %}ok{% endif %}</td>
    </tr>
    {% endfor -%}
    {% endfor -%}
    </tbody>
</table>
{% endif -%}
{% endblock -%}